NDepend.API Documentation
ContainsSameCodeElementsThan<TCodeElement>(IEnumerable<TCodeElement>,HashSet<TCodeElement>) Method
NDepend.CodeModel Namespace > ExtensionMethodsHelpers Class > ContainsSameCodeElementsThan Method : ContainsSameCodeElementsThan<TCodeElement>(IEnumerable<TCodeElement>,HashSet<TCodeElement>) Method
The code element type that is ICodeElement or that implements ICodeElement.
This sequence of code elements objects.
The hahshet of code elements objects.
Returns true if this codeElements sequence contains the same set of code elements than the otherCodeElementsHashset hashset. Otherwise returns false.
Syntax
[Extension()]
public static bool ContainsSameCodeElementsThan<TCodeElement>( 
   IEnumerable<TCodeElement> codeElements,
   HashSet<TCodeElement> otherCodeElementsHashset
)
where TCodeElement: class, ICodeElement

Parameters

codeElements
This sequence of code elements objects.
otherCodeElementsHashset
The hahshet of code elements objects.

Type Parameters

TCodeElement
The code element type that is ICodeElement or that implements ICodeElement.
Remarks
This ContainsSameCodeElementsThan<TCodeElement>(IEnumerable<TCodeElement>,IEnumerable<TCodeElement>) overload, relies on the fact that otherCodeElementsHashset is a hashset to execute with a faster O(codeElements.Count) time complexity.
Notice that codeElements can contain doublons, hence this operation first gets codeElements.Distinct().
otherCodeElementsHashset necessarily contains distinct code elements.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsHelpers Class
ExtensionMethodsHelpers Members
Overload List